<?php

namespace Wantuch\SurveyBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class InvitationType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('name')
            ->add('surname')
            ->add('email')
            //->add('token')
            ->add('filled','choice', array(
                'choices'   => array('T' => 'Tak', 'N' => 'Nie'),
                'required'  => true,
                'expanded' => true,
                'multiple' => false
            ))
            //->add('createdAt')
            //->add('updatedAt')
            ->add('survey')
        ;
    }
    
    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Wantuch\SurveyBundle\Entity\Invitation'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'wantuch_surveybundle_invitation';
    }
}
